import random

def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[0]  # 选择第一个元素作为基准（也可随机选择）
    left = [x for x in arr if x < pivot]
    mid =  [x for x in arr if x == pivot ]
    right = [x for x in arr if x > pivot]
    return quick_sort(left) + mid + quick_sort(right)

# 测试
arr = [random.randint(1,100) for i in range(10)]

print("快速排序结果:", quick_sort(arr))
#这是快速练习
